public class Phone implements Comparable<Phone> {

    private Long phone;
    private Integer calls;
    private Double balance;

    public Phone(Long phone, Integer calls, Double balance) {
        this.phone = phone;
        this.calls = calls;
        this.balance = balance;
    }

    public Phone() {
    }

    public Long getPhone() {
        return phone;
    }

    public Integer getCalls() {
        return calls;
    }

    public Double getBalance() {
        return balance;
    }

    public void setPhone(Long phone) {
        this.phone = phone;
    }

    public void setCalls(Integer calls) {
        this.calls = calls;
    }

    public void setBalance(Double balance) {
        this.balance = balance;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "phone=" + phone +
                ", calls=" + calls +
                ", balance=" + balance +
                '}';
    }

    @Override
    public int compareTo(Phone o) {
        return balance > o.balance ? -1 : 1;
    }

}
